//#include "stm32f10x.h"                  // Device header
  //#include "Delay.h"

//#define GPIOA_BASE 0x40010800


#define RCC_APB2ENR (*(unsigned int *)0x40021018)	

#define GPIOA_CRL (*(unsigned int *)0x40010800)

#define GPIOA_ODR (*(unsigned int *)0x4001080C)
	
#define GPIOC_CRH (*(unsigned int *)0x40011004)//c口的高八位配置
	
#define GPIOC_ODR (*(unsigned int *)0x4001100c)//c口输出寄存器配置


void Delay_ms( volatile  unsigned  int  t)
{
     unsigned  int  i;
     while(t--)
         for (i=0;i<800;i++);
}


int main()
{
	   RCC_APB2ENR |=(1<<2);// 打开 GPIOA 时钟，（1<<2）意思是，将1左移两位，然后再与RCC或运算
	    RCC_APB2ENR |=(1<<4);//c时钟
	
	   GPIOA_CRL &=0xfffff000;//端口A低配置寄存器
	   GPIOA_CRL |=0x00000111;
	
	   GPIOC_CRH &=0xff0fffff;//端口C
	   GPIOC_CRH |=0x00100000;
	    
	  GPIOC_ODR |=0xffffffff;
	
	  GPIOA_ODR |=0xffffffff;//端口电平设置
	 while(1)
	 {  
		 GPIOA_ODR &=0xfffffffe;//将A0口置0，点亮LED
      Delay_ms(10000);       //延时函数
		 GPIOA_ODR |=0xffffffff;//又将输出端口全部变为高电平，灭灯
		 Delay_ms(10000);
		 
		 GPIOA_ODR &=0xfffffffd;//A1口
		   Delay_ms(10000);
		   GPIOA_ODR |=0xffffffff;
		 Delay_ms(10000);
		 
		  GPIOA_ODR &=0xfffffffb;//A2口
		  Delay_ms(10000);
		 GPIOA_ODR |=0xffffffff;
		 Delay_ms(10000);
		 
		 GPIOC_ODR &=0xffffdfff;
		  Delay_ms(10000);
		 GPIOC_ODR |=0xffffffff;
		 Delay_ms(10000);
	 }

	
}


